import Vue from "vue";
import VueRouter from "vue-router";
import page_header from "../components/common/header.vue";
import page_foot from "../components/common/foot.vue";
import left_nav from "../components/common/left_nav.vue";

Vue.use(VueRouter);

const routes = [
  // { path: "/", redirect: { name: "App" } },
  // {
  //   path: "/",
  //   name: "App",
  //   component: App,
  // },

  {
    path: "/",
    name: "home",
    components: {
      page_header,
      page_foot,
      notice: () => import("@/views/notice.vue"),
      carousel: () => import("@/views/carousel.vue"),
      information: () => import("@/views/information.vue"),
      job_recruitment: () => import("@/views/job_recruitment.vue"),
    },
  },
  {
    path: "/login",
    name: "login",
    components: {
      login: () => import("@/views/login.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/register",
    name: "register",
    components: {
      register: () => import("@/views/register.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/notice/list",
    name: "notice_list",
    components: {
      notice_list: () => import("@/views/notice_list.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/notice/detail",
    name: "notice_detail",
    components: {
      notice_detail: () => import("@/views/notice_detail.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/information/list",
    name: "information_list",
    components: {
      information_list: () => import("@/views/information_list.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/information/detail",
    name: "information_detail",
    components: {
      information_detail: () => import("@/views/information_detail.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/job_recruitment/detail",
    name: "job_recruitment_detail",
    components: {
      job_recruitment_detail: () =>
        import("@/views/job_recruitment_detail.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/job_recruitment/list",
    name: "job_recruitment_list",
    components: {
      job_recruitment_list: () => import("@/views/job_recruitment_list.vue"),
      page_header,
      page_foot,
    },
  },
  {
    path: "/personal_center",
    name: "personal_center",
    components: {
      personal_center: () => import("@/views/personal_center.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/seekersInfo",
    name: "seekersInfo",
    components: {
      seekersInfo: () => import("@/views/seekersInfo.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/resume_detail",
    name: "resume_detail",
    components: {
      resume_detail: () => import("@/views/resume_detail.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/resume_list",
    name: "resume_list",
    components: {
      resume_list: () => import("@/views/resume_list.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/resume_add",
    name: "resume_add",
    components: {
      resume_add: () => import("@/views/resume_add.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/enterprise_information",
    name: "enterprise_information",
    components: {
      enterprise_information: () =>
        import("@/views/enterprise_information.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/enterprise_job_list",
    name: "enterprise_job_list",
    components: {
      enterprise_job_list: () => import("@/views/enterprise_job_list.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/enterprise_job_detail",
    name: "enterprise_job_detail",
    components: {
      enterprise_job_list: () => import("@/views/enterprise_job_detail.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/publish_job",
    name: "publish_job",
    components: {
      publish_job: () => import("@/views/publish_job.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/deliver_resume_list",
    name: "deliver_resume_list",
    components: {
      deliver_resume_list: () => import("@/views/deliver_resume_list.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/deliver_resume_detail",
    name: "deliver_resume_detail",
    components: {
      deliver_resume_detail: () => import("@/views/deliver_resume_detail.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/enterprise_deliver_resume_list",
    name: "enterprise_deliver_resume_list",
    components: {
      enterprise_deliver_resume_list: () =>
        import("@/views/enterprise_deliver_resume_list.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/personal_center/comment_list",
    name: "comment_list",
    components: {
      comment_list: () => import("@/views/comment_list.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
  {
    path: "/user/change_password",
    name: "change_password",
    components: {
      change_password: () => import("@/views/change_password.vue"),
      page_header,
      page_foot,
      left_nav,
    },
  },
];

const router = new VueRouter({
  routes,
});

export default router;
